﻿// JScript 文件
//修改日期：2007.07.07 

//var m_pageSize =30;
var m_dlg = null;
var m_bClose = false;
var m_type = "LAN" //局向信息
String.prototype.isNum = function()
{
    for (var i = 0; i < this.length; i++ )
    {
        if(this.charAt(i) < '0' || this.charAt(i) > '9')
        {
            return false;
        }
    }
    return true;
}

var fxhLbNodes = "";
var taFxhPageLb = 0;

function GetAgainLoginInfo()
{
    if (this.req.responseText == "YES")
    {
        with(document.getElementById("BgMask").style)
        {
             display="none";
        }
        with(document.getElementById("loginAgainDiv").style)
        {
             display="none";
            ZyqrFrame.userName.value="";
            ZyqrFrame.passWord.value="";
        }
         InitDefault();
        // window.location.href = "Default.aspx?" + Math.random(10);  
   }
   else if (this.req.responseText != "")
   {
      alert(this.req.responseText);
   }
}
function SysLoginAgain()
{
    if(event.keyCode=="13")
    {
      LoginAgain();
    }
}
 
function DzclearAll(typeid)
{  
    if(typeid=="Reset")//
     {
      ZyqrFrame.txtNextAddr.value="";
//      GetCity(1,0,null);
      ZyqrFrame.Addr1.selectedIndex = 0;
      ZyqrFrame.Addr2.selectedIndex = 0;
　    ZyqrFrame.txtNextAddr.value = "";
      ZyqrFrame.YhHm.value = "";
      ZyqrFrame.txtJxBm.value = "";
      document.getElementById("UserInfo").style.display="none";
      document.getElementById("NowMassage").style.display="none";
      ZyqrFrame.chkAddNet.disable=true;
      ZyqrFrame.chkAddNet.checked=false;
      ZyqrFrame.ChFj.checked=true;
      ZyqrFrame.CheLan.checked=false;
      
      vaddNet ="";
      document.getElementById("JxXX").style.display="none";
      document.getElementById("NlResult").innerHTML="";
    }
   else if(typeid=="FenJi")//选中分级地址
    {
      document.getElementById("Result").innerHTML=""; 
      ZyqrFrame.Addr1.disabled = false;
      ZyqrFrame.Addr2.disabled = false;
    　ZyqrFrame.txtNextAddr.disabled = false;
      ZyqrFrame.YhHm.disabled = true;
      vaddNet ="";
      ZyqrFrame.chkAddNet.disabled=true;
      ZyqrFrame.chkAddNet.checked=false;
      ZyqrFrame.txtJxBm.disabled = false;
      document.getElementById("JxXX").style.display="none";
      document.getElementById("UserInfo").style.display="none";
      document.getElementById("NowMassage").style.display="none";
      document.getElementById("NlResult").innerHTML="";
      CheAddNet();
    }
    else if(typeid=="Tel")//选中业务号码
    {
        vaddNet ="";
        document.getElementById("Result").innerHTML="";
       // document.getElementById("NlResult").innerHTML="";
        document.getElementById("JxXX").style.display="none";
        document.getElementById("UserInfo").style.display="none";
        document.getElementById("NowMassage").style.display="none";
        ZyqrFrame.Addr1.disabled = true
        ZyqrFrame.Addr2.disabled = true;
    　　ZyqrFrame.txtNextAddr.disabled = true;
    　　ZyqrFrame.txtJxBm.disabled = true;
        ZyqrFrame.YhHm.disabled = false;
        ZyqrFrame.chkAddNet.disabled=false;
        CheAddNet();
    }
    else if(Ctypeid=="GgSs")//公共设施
    {
        vaddNet ="";
        document.getElementById("Result").innerHTML="";
        document.getElementById("NlResult").innerHTML="";
        document.getElementById("JxXX").style.display="none";
        document.getElementById("UserInfo").style.display="none";
        document.getElementById("NowMassage").style.display="none";
        ZyqrFrame.DzZw.disabled = true;
        ZyqrFrame.DzJp.disabled = true;
        ZyqrFrame.jpzw.disabled = true;
        ZyqrFrame.Qyzt.disabled = true;
        ZyqrFrame.Addr1.disabled = true
        ZyqrFrame.Addr2.disabled = true;
    　　ZyqrFrame.txtNextAddr.disabled = true;
        ZyqrFrame.YhHm.disabled = true;
        ZyqrFrame.JxBm.disabled = true;
        ZyqrFrame.chkAddNet.disabled=true;
        ZyqrFrame.Yyq.disabled = true;
        CheAddNet();
       // ZyqrFrame.txtGgSs.disabled = false;
    }
}
function SetYyqName()
{
   // new net.ContentLoader("query.ashx?", GetYyqName, null, "_method=GetYyq"); 
    var params = "_method=GetYyq";
    CtnTrans.Ajax("/main.ashx", "post", params,GetYyqName,null,{loading:true,loadingText:"系统查询中，请稍候..."}); 
}
function GetYyqName()
{
//    var XmlVal = getXmlDoc()
//    if (XmlVal == null)
//    {
//        alert("不能创建XML对象")
//        return
//    }
//    var vError = this.req.responseText.split("#|$");
//    if(vError.length==2)
//    {
//       alert(vError[1]);
//       if(vError[1]=="页面已过期，请重新登录")
//       {
//          LoadingAgain();
//       }
//       ZyqrFrame.btQurey.disabled=false;
//       return;
//    }
    var ResText = res.responseText;
    if (!CtnError.validate(ResText))
    {
        CtnError.show();
        return;
    }
    else
    {
         var XmlVal = CtnXML.getXmlDoc();
         XmlVal.loadXML(ResText);
    }
    XmlVal.loadXML(ResText);
    var root =  XmlVal.selectNodes('Items');
    var nodes = XmlVal.selectNodes('Items/Item');
    var ZqyOption = document.createElement("OPTION");
    ZqyOption.value = "";
    ZqyOption.text  = "请选择--"; 
    ZyqrFrame.Yyq.add(ZqyOption);
    if(nodes.length==0)
    {
       return; 
    }
    else
    {
       for(var i = 0; i < nodes.length; i++)
        {
           var Dbval= nodes[i].selectNodes("dbval");
           var Dispval = nodes[i].selectNodes("dispval");
           var StatusOption = document.createElement("OPTION");
           StatusOption.text=Dispval[0].text;
           StatusOption.value=Dbval[0].text;
           ZyqrFrame.Yyq.add(StatusOption); 
        }
        setYyq();
     }
}
function ShowLi(elem)
{   
    var parent = elem.parentNode.parentNode;
    var arrLi = parent.getElementsByTagName("li");
    for (var i = 0; i < arrLi.length; i++)
    {
       arrLi[i].childNodes[0].className = "";
    }
    elem.className = "current";
    if(elem.innerText=="公共设施")
    {  
       vGgssChe = 1;
       document.getElementById("Result").style.display="none";
    }
    else
    {  
       vGgssChe = 0;
       document.getElementById("Result").style.display="block";
    }
}

//公共设施显示
function ShowGgSsMassage()
{
//      var XmlVal=getXmlDoc();
//      if(XmlVal==null)
//      {
//         alert("不能创建XML对象");
//         return ;
//       }
//       var VResPonse = this.req.responseText.split("#|$");
//       if(VResPonse.length==2 )
//       { 
//           alert(VResPonse[1]);
//           if(VResPonse[1]=="页面已过期，请重新登录")
//           {
//              LoadingAgain();
//           }
//           ZyqrFrame.btQurey.disabled=false;
//           return;
//       }
    var ResText = res.responseText;
    if (!CtnError.validate(ResText))
    {
        CtnError.show();
        return;
    }
    else
    {
         var XmlVal = CtnXML.getXmlDoc();
         XmlVal.loadXML(ResText);
    }
       var VResPonse = ResText.split("#@$");
       var XmlText = VResPonse[0];
       XmlVal.loadXML(XmlText);
       Detailresult = XmlText;
       //taFxhPage = VResPonse[2];
       vAllItemGgSs = VResPonse[1];
       iNowPageCountGgSs = VResPonse[2];
       var root = XmlVal.selectNodes('Items');
       var nodes = XmlVal.selectNodes('Items/Item');
       if(nodes.length==0)
       { 
          if(vAllItemGgSs=="0")
          {
               alert("没有找到相关信息，请重新查询...");
//               var ResultFxhDiv=IframeBar.document.getElementById("tdOverQurey");
//               ResultFxhDiv.innerHTML = "0";
//               IframeBar.document.getElementById("btSureQurey").disabled = false;
          }
          else
          {     
                currentPageDetLb--;
                alert("这已经是最后一页!");
          }
            ZyqrFrame.btQurey.disabled=false;
            return;
       }
        else
        {
           m_fxhNodesGgSs = nodes;
           goGgSsPage();
        }
}
function goGgSsPage()
{
    var CharCurrenId0 ="";
    var start = 0;
    var end = m_pageSize *  currentPageDetLb;
    var vResCode = "";
    var vResType = "";
    if(end > m_fxhNodesGgSs.length)
    {
       end = m_fxhNodesGgSs.length;
    }
    var ResultFxhDiv=document.getElementById("divGgResult");
    var str="<table cellSpacing='0' cellPadding='0' width='93%' align='center' border='1' bordercolor=gray  style='background-color:#d9e7f8;'>";
    str+="<tr  style='COLOR: black; FONT-FAMILY: 宋体'><td align=center width=30px>序号</td><td  align=center>设施名称</td>";
    for(var i = start; i < end; i++)
    {
         var xmlid0     = m_fxhNodesGgSs[i].selectNodes("ID0");
         var xmlMC     = m_fxhNodesGgSs[i].selectNodes("MC");
         var xmlWz = m_fxhNodesGgSs[i].selectNodes("GGSSWZ");
         var xmlHY     = m_fxhNodesGgSs[i].selectNodes("HY");
         var disMc = xmlMC[0].text;
         var disWz = xmlWz[0].text;
         var disHy = xmlHY[0].text;
         var vAddrId0 = xmlid0[0].text;
         CharCurrenId0 += vAddrId0+"#@$";
         var vId0Wz = vAddrId0+"#@$"+disWz;
         var j= parseInt(i)+1+m_pageSize *  (currentPageDetLb-1);
        // str+="<tr><td align=center >"+j+"</td><td   align=center title='所属行业："+disHy+"\n所在位置:"+disWz+"'><span id="+vId0Wz+" onclick='GetYx(this)'><a href='javascript:void(0);'>"+disMc+"</a></span></td></tr>";
         str+="<tr><td align=center >"+j+"</td><td   align=center title='所在位置:"+disWz+"'><span id="+vId0Wz+" onclick='GetYx(this)'><a href='javascript:void(0);'>"+disMc+"</a></span></td></tr>";
     }
          str += "</tr></table>";
          var strPage= "<table>";
          top.CharGgSsId0 = CharCurrenId0+top.currentPageDetLb;
     strPage += "<tr><td align=center width='15%'><a href='javascript:goPre(3);'>"+prePage+"</a></td>";
    if(parseInt(iNowPageCountGgSs)<7)
    {
        vStartPage = 1;
        vEndPage = parseInt(iNowPageCountGgSs)+1;  
    }
    if(( currentPageDetLb)%6==0 &&  currentPageDetLb>5 && isKPage)
    {
        vStartPage= currentPageDetLb-5;
        if(parseInt(iNowPageCountGgSs)>parseInt(vStartPage)+6)
        {
            vEndPage=parseInt(vStartPage)+6;
        }
        else
        {
            vEndPage=parseInt(iNowPageCountGgSs);
        }
    }
    if((( currentPageDetLb-1)%6==0 &&  currentPageDetLb>1) || (( currentPageDetLb == parseInt(prePageCount)|| currentPageDetLb == parseInt(prePageCount)+1)&&prePageCount!=null) )//下一页会翻的那页
    {
        vStartPage= currentPageDetLb;
      if(( currentPageDetLb == parseInt(prePageCount)|| currentPageDetLb == parseInt(prePageCount)+1)&&prePageCount!=null)
      {
         vStartPage=parseInt( currentPageDetLb)-(parseInt( currentPageDetLb)%6)+1;
         if(parseInt( currentPageDetLb)%6==0)
         {
            vStartPage= currentPageDetLb-5;
         }
      }
     if(parseInt(iNowPageCountGgSs)>=parseInt(vStartPage)+6)
       {
           vEndPage=parseInt(vStartPage)+6;
       }
       else
       {
           vEndPage=parseInt(iNowPageCountGgSs) + 1;
       }
    }
    if(vEndPage==1)
    {
      strPage +="<td align=center  width='5%'><a href='javascript:GotoPage("+vEndPage+");'><font color=red>"+vEndPage+"</font>&nbsp</a></td>";
    }
    else
    {
        for( var j= vStartPage;j<vEndPage;j++)
        {   
             
             if( currentPageDetLb==j)
             { 
               strPage +="<td align=center  width='5%' ><a href='javascript:GotoPageGgSs("+j+");'><font color=red>"+j+"</font>&nbsp</a>";
             }
             else
             {
               strPage +="<td align=center  width='5%'><a href='javascript:GotoPageGgSs("+j+");'>"+j+"&nbsp</a>";
             }
             strPage +="</td>";
        }
    }
    strPage += "<td align=center  width='25%'><a href='javascript:goNext(3);'>"+nextPage+"</a></td></tr></table>";
    prePageCount = iNowPageCountGgSs;
    isKPage = false
//    strPage += "<td align=center  width='20%'><a href='javascript:goNext(3);'>"+nextPage+"</a></td><td align=center  width='20%'><a href='javascript:goLast(3);'>"+lastPage+"</a></td></tr></table>";
    strPage += "<table  width='93%'  align='center' border='1' cellSpacing='0' cellPadding='0' bordercolor=gray><tr height=20 align='center'></td><td align=center width='10%' >当前第"+ currentPageDetLb+"页</a><td align=center width='10%'>每页10条</a><td align=center width='10%' >约有"+vAllItemGgSs+"条符合记录</a></td></tr></table>";
    var  strFxh= (str+=strPage);
    ResultFxhDiv.innerHTML = strFxh;
    ZyqrFrame.btQurey.disabled=false;
    LocateType="21";
}   

function ShowAddrMsg()
{
//    var XmlVal=getXmlDoc();
//    if(XmlVal==null)
//    {
//    alert("不能创建XML对象");
//    return ;
//    }
//    var VResPonse = this.req.responseText.split("#|$");
//    if(VResPonse.length==2 )
//    { 
//        alert(VResPonse[1]);
//        if(VResPonse[1]=="页面已过期，请重新登录")
//        {
//           LoadingAgain();
//        }
//        ZyqrFrame.btQurey.disabled=false;
//        return;
//    }
    var ResText = res.responseText;
    if (!CtnError.validate(ResText))
    {
        CtnError.show();
        return;
    }
    else
    {
         var XmlVal = CtnXML.getXmlDoc();
         XmlVal.loadXML(ResText);
    }
    var VResPonse = ResText.split("#@$");
    var XmlText = VResPonse[0];
    var vResType =  VResPonse[1];
    var vResCode = VResPonse[2];
    if(XmlText==null || XmlText == "")
    {
       alert("没有找到相关信息，请重新查询...");
       var ResultFxhDiv=IframeBar.document.getElementById("tdOverQurey");
       ResultFxhDiv.innerHTML = "0";
       IframeBar.document.getElementById("btSureQurey").disabled = true;

    }
    else
    {
       Detailresult = "1";
     //  fxhLbNodes = nodes;
       fxhLbNodes = XmlText;

       currentPageDetLb = 1;
       goFxhPageLb(currentPageDetLb);
       if((vResType!=null && vResType!="") && (vResCode!=null && vResCode!=""))
       {
             GetEntLocate(vResType,vResCode);
       }
    }
}
function goFxhPageLb(currentPageDetLb)
{
      top.m_vFxhLb = "";
//      var pageSize =10;
      var start = m_pageSize * (currentPageDetLb - 1);
      var end = m_pageSize * currentPageDetLb;//taFxhPageLb goFxhLbPage
      var tempTatol = parseInt(fxhLbNodes.length/m_pageSize);
      var azWz = "";
      var vFxhBm = "";
      var AddrId0 = "";
      var vFgFw = "";
      var vJl = ""; 
      var vLstBm = "";
      var vLstWz = "";
      var vLstAddrId0 = "";
      var vLstJl = ""; 
      var vFgfw = "";
      if(tempTatol * m_pageSize< fxhLbNodes.length)
      {
         taFxhPageLb = tempTatol + 1;
      }
      else
      {
        taFxhPageLb = tempTatol;
      }
      if(end > fxhLbNodes.length)
      {
         end = fxhLbNodes.length;
      }
      // var ResultFxhDiv=IframeBar.document.getElementById("tdOverQurey");
        var vDataFxhAll = fxhLbNodes.split("|");
        var vDataFxhOne = "";
         vDataFxhOne  = vDataFxhAll[0].split("$");
        if(vDataFxhOne.length<=0)
        {
            return;
        }
        top.azWz =vDataFxhOne[1];
        top.m_vFxhLb = fxhLbNodes;
        ResultFxhDiv.innerHTML = vDataFxhAll.length;
       // IframeBar.document.getElementById("btSureQurey").disabled = false;
  }  
function feedback()
{
   
}
function goPreLan(currenPage)
{ 
    if(currenPage<=1)
    { 
        alert("当前已经是第一页！");
        return;
    }
    else
    {
       currenPage = currenPage - 1;
       goLanPageLb(currenPage)
    }
}
function goNextLan(currenPage)
{ 
   
     if(currenPage == taFxhPageLb)
      {
        alert("当前已经是最后一页了！");
        if(currenPage!="1")
        {
          currenPage=parseInt(currenPage)-1;
        }
        return ;
      }
      else
      {
        currenPage = parseInt(currenPage) + 1;
        goLanPageLb(currenPage)
      }
 }
function goFirstLan(currenPage)
{
        if(currenPage == 1)
        {
            alert("当前已经是第一页！");
            return ;
         }  
        currenPage = 1;
        goLanPageLb(currenPage)
}
function goLastLan(currenPage)
{
     if(currenPage == taFxhPageLb)
      {
         alert("当前已经是最后一页了！");
         if(currenPage!="1")
         {
             currenPage=parseInt(currenPage)-1;
         }
        return ; 
      }
     currenPage = taFxhPageLb;
     goLanPageLb(currenPage)
}
function GotoPageLan(iPage)
{
  if(iPage==1&&currentPageDetLb==1)
  {
    return;
  }
  currentPageDetLb = iPage;
  dzQuery(iPage, 0);
}
function ShowPx()
{
     var XmlVal=getXmlDoc();
     if(XmlVal==null)
     {
       alert("不能创建XML对象");
       return ;
      }
      ResPonse = this.req.responseText.split("#|$");
      if(ResPonse.length==2)
      {  
        alert(ResPonse[1]);
        if(ResPonse[1]=="页面已过期，请重新登录")
        {
           LoadingAgain();
         }
         ZyqrFrame.btQurey.disabled=false;
         return;
      }
      else
      {
         XmlVal.loadXML(this.req.responseText); 
      }
     var root = XmlVal.selectNodes('Items');
     var nodes = XmlVal.selectNodes('Items/Item');
     if(nodes.length==0)
     { 
        alert("无配线...")
     }
     else
     {
        alert("无主干...");
     }
} 

//点击公共设施后，范围查询
function QureyCir()
{ 
    //top.IframeBar.document.getElementById("btSureQurey").disabled = true;
   // var ResultFxhDiv=top.IframeBar.document.getElementById("tdOverQurey");
   // ResultFxhDiv.innerHTML = "查询中...";
//    var vRadius =top.m_vRadius;
//    var vXY = top.m_vGgSsXY;
//    if(vXY =="")
//    {
//       alert("您还没有在地图上标注位置，请先标注...");
//       top. UnLoading();
//       ResultFxhDiv.innerHTML = "0";
//       return;
//    }
//    var loaderXml = new net.ContentLoader("query.ashx?", ShowAddrMsg, null, "_method=GetCirFxh&vRadius="+vRadius+"&vXY="+vXY+"&QureyType="+1);
//    DispDiv();
}
function GetFgFwXy(res)
{
//     var  ResPonse = this.req.responseText.split("#|$");
//     if(ResPonse.length==2)
//     {  
//         alert(ResPonse[1]);
//         if(ResPonse[1]=="页面已过期，请重新登录")
//         {
//             LoadingAgain();
//         }
//         ZyqrFrame.btQurey.disabled=false;
//         return;
//      }
    var ResText = res.responseText;
    if (!CtnError.validate(ResText))
    {
        CtnError.show();
        return;
    }
    else
    {
         var XmlVal = CtnXML.getXmlDoc();
         XmlVal.loadXML(ResText);
    }
    var VResPonse = this.req.responseText.split("#@$");
    var vX = VResPonse[0];
    var vY = VResPonse[1];
    vFgFwXY = vX+":"+vY;
    ShowDivQurey(null,null);
      
}
//直接圆心查询
function FgfwQureyCir()
{
   //top.IframeBar.document.getElementById("btSureQurey").disabled = true;
//    var ResultFxhDiv=top.IframeBar.document.getElementById("tdOverQurey");
//    ResultFxhDiv.innerHTML = "查询中...";
//    top.Loading()
//    var vRadius = top.m_vRadius;
//    if(top.vFgFwXY=="")
//    {
//       alert("您还没有在地图上标注位置，请先标注...");
//       top. UnLoading();
//       ResultFxhDiv.innerHTML = "0";
//       return;
//    }
//    var loaderXml = new net.ContentLoader("query.ashx?",ShowAddrMsg, null, "_method=GetCirFxh&vRadius="+vRadius+"&vXY="+top.vFgFwXY+"&QureyType="+2);
//    DispDiv();
    top. UnLoading();
}
//配线系统运行时自动获取分线盒列表
function ShowDetailFxh(vAddrId0,vResType,vResCode,vFgfw)
{
}
//设施定位
function GetYx(ID)
{  
    var DivQureyFxh = document.getElementById("DivQureyFxh");
    DivQureyFxh.style.display = "none";
    var vid = ID.id; 
    var arrData = vid.split("#@$");
    top.GgSs = ID.outerText;
    var vAddrId0  = arrData[0];
    top.GgSsWz = arrData[1];
    top.LocateType="21";
    var params =  "_method=GgSsLocat&vAddrid0="+vAddrId0+"&vCirType="+1;
    CtnTrans.Ajax("/main.ashx", "post", params,AddrLocat,null,{loading:true,loadingText:"系统查询中，请稍候..."}); 

   // var loaderXml = new net.ContentLoader("query.ashx?",AddrLocat,null,"_method=GgSsLocat&vAddrid0="+vAddrId0+"&vCirType="+1); 
}
function AddrLocat()
{
     var XmlVal = getXmlDoc()
     if (XmlVal == null)
     {
          alert("不能创建XML对象");
          return;
     }
     var  ResPonse = this.req.responseText.split("#|$");
     if(ResPonse.length==2)
     {  
       
          alert(ResPonse[1]);
          if(ResPonse[1]=="页面已过期，请重新登录")
          {
             LoadingAgain();
          }
          ZyqrFrame.btQurey.disabled=false;
          return;
     }
     else
     {
          ResPonse = this.req.responseText.split("#@$");
     }

     var vX = ResPonse[0];
     var vY = ResPonse[1];
     var ID = ResPonse[2];
     var vAddrId0 = ID;
     EntLocateByType(1,21,vAddrId0);
     top.m_vGgSsXY = vX+":"+vY;
}
//地址查询获取的LAN信息
function ShowLan(ID)
{
    var vid = ID.id;
    var arrData = vid.split("#|$");
    var vJxBm   =  arrData[0];
    var lanCode = arrData[1];
    var vFgfw   = arrData[2].replace(" ","");
    var params =  "_method=GetLanInfo&vJxbm="+vJxBm+"&vFgfw="+vFgfw+"&lanCode="+lanCode;
    CtnTrans.Ajax("/main.ashx", "post", params,shwoLanInfo,null,{loading:true,loadingText:"系统查询中，请稍候..."}); 

    //var loaderXml = new net.ContentLoader("query.ashx?",shwoLanInfo,null,"_method=GetLanInfo&vJxbm="+vJxBm+"&vFgfw="+vFgfw+"&lanCode="+lanCode); 
}
function ShowLanByTel(vLanJxbm,vLanCode,vFgfw)
{
    var params = "_method=GetLanInfo&vJxbm="+vLanJxbm+"&vFgfw="+vFgfw+"&lanCode="+vLanCode; 
    CtnTrans.Ajax("/main.ashx", "post", params,shwoLanInfo,null,{loading:true,loadingText:"系统查询中，请稍候..."}); 

    //var loaderXml = new net.ContentLoader("query.ashx?",shwoLanInfo,null,"_method=GetLanInfo&vJxbm="+vLanJxbm+"&vFgfw="+vFgfw+"&lanCode="+vLanCode); 
}
function shwoLanInfo()
{
     var XmlVal=getXmlDoc();
      if(XmlVal==null)
      {
         alert("不能创建XML对象");
         return ;
       }
       var VResPonse = this.req.responseText.split("#|$");
       if(VResPonse.length==2 )
       { 
           alert(VResPonse[1]);
           if(VResPonse[1]=="页面已过期，请重新登录")
           {
              LoadingAgain();
           }
           ZyqrFrame.btQurey.disabled=false;
           return;
       }
       var VResPonse = this.req.responseText.split("#@$");
       var XmlText = VResPonse[0];
       XmlVal.loadXML(XmlText);
       var root = XmlVal.selectNodes('Items');
       var nodes = XmlVal.selectNodes('Items/Item');
       if(nodes.length==0)
       { 
           alert("没有找到相关信息，请重新查询...");
       }
        else
        {
           Detailresult = "1";
           fxhLbNodes = nodes;
           currentPageDetLb = 1;
           goLanPageLb(currentPageDetLb);
        }
    
}
function goLanPageLb(currentPageDetLb)
{
      var start = m_pageSize * (currentPageDetLb - 1);
      var end = m_pageSize * currentPageDetLb;//taFxhPageLb goFxhLbPage
      var tempTatol = parseInt(fxhLbNodes.length/m_pageSize);
      var vJxBm = "";
      var vJxmc = "";
      var vFgFw = "";
      var vLanCount = "";

      if(tempTatol * m_pageSize< fxhLbNodes.length)
      {
         taFxhPageLb = tempTatol + 1;
      }
      else
      {
        taFxhPageLb = tempTatol;
      }
      if(end > fxhLbNodes.length)
      {
         end = fxhLbNodes.length;
      }
      var ResultFxhDiv=document.getElementById("NlResult");
      var str="<table cellSpacing='0' cellPadding='0' width='95%' align='center' border='1' bordercolor=gray style='background-color:grey'>";
      str+="<tr height=20px style='COLOR: black; FONT-FAMILY: 宋体'><td align=center height=20px width='8%'>局向信息</td>";
      str+="<td align=center width='8%'>覆盖地址</td><td align=center width='9%'>接入点LAN端口空闲数量</td><td align=center width='9%'>该局向LAN端口空闲数量</td>";
      if(window.softType=="YTQ")
      {
             str+="<td align=center width='7%'>选择资源</td>";
      }
      str+="</tr>";
      for(var i = start; i < end; i++)
      {
           var xmlJxmc        = fxhLbNodes[i].selectNodes("JXMC");
           var xmlJxbm        = fxhLbNodes[i].selectNodes("JXBM");
           var xmlFgfw        = fxhLbNodes[i].selectNodes("FGFW");
           var xmlJxLanCount  = fxhLbNodes[i].selectNodes("LANCOUNT");
           var xmlJrdLanCount = fxhLbNodes[i].selectNodes("JRDLAN");
           var xmlNetresCode   = fxhLbNodes[i].selectNodes("NETRESCODE");
           var xmlNetresType   = fxhLbNodes[i].selectNodes("NETRESTYPE");
           var vJxBm = xmlJxbm[0].text;
           var vJxmc = xmlJxmc[0].text;
           var vFgFw = xmlFgfw[0].text;
           var vJrdLanCount = xmlJrdLanCount[0].text;
           var vJxLanCount = xmlJxLanCount[0].text;
           var vNetCode = xmlNetresCode[0].text;
           if(i == start)
           {
                top.JxMasse = vJxmc+"("+vJxBm+")"
                top.ZjLanCOunt = vJrdLanCount;
                top.vFgfwBm = vFgFw;
                top.JxLanCount = vJxLanCount
            }
           var vLanSource = vNetCode +"#|$"+xmlNetresType[0].text+"#|$"+vJxBm
           str += "<tr  height=20 id=Deital><td align=center> <font color='#003399'>"+ChgUndefined(vJxmc)+"("+ChgUndefined(vJxBm)+")"+"</font></td>";
           str +="<td align=center><font color='#003399'>"+ChgUndefined(vFgFw)+"</font><font color=red>(存在LAN设备)</font></td>";
           str +="<td align=center><font color='#003399'>"+ChgUndefined(vJrdLanCount)+"</font></td>";
           str +="<td align=center><font color='#003399'>"+ChgUndefined(vJxLanCount)+"</font></td>";
           if(window.softType=="YTQ")
           {
               str+="<td align=center width='7%'><span id="+vLanSource+" onclick='SaveResurce(this)'><a href='javascript:void(0);'><u>确定</u></a></td>";
           }
           str+="</tr>";
        }
        str += "</table>";
        var strPage= "<table cellSpacing='0' cellPadding='0' width='100%'  align='center' border='0' bordercolor=gray>";
        strPage += "<tr height=20></td><td align=center width='10%' >当前第"+currentPageDetLb+"页</a><td align=center width='10%'>每页10条</a><td align=center width='10%' >总共"+taFxhPageLb+"页</a></td>";
        strPage += "<td align=center width='15%' ><a href='javascript:goFirstLan("+currentPageDetLb+");'>"+firPage+"</a></td><td align=center width='15%'><a href='javascript:goPreLan("+currentPageDetLb+");'>"+prePage+"</a></td>";
        strPage += "<td align=center  width='20%'><a href='javascript:goNextLan("+currentPageDetLb+");'>"+nextPage+"</a></td><td align=center  width='20%'><a href='javascript:goLastLan("+currentPageDetLb+");'>"+lastPage+"</a></td></tr></table>";
        var  strFxh= (str+=strPage);
        ResultFxhDiv.innerHTML = strFxh;
        LocateType="28";

        GetEntLocate(m_LanNum,xmlNetresCode[0].text);
  }  
var m_lanTable=null
function shwoDetailLan()
{
    var XmlVal = getXmlDoc()
    if (XmlVal == null)
    {
        alert("不能创建XML对象")
        return
    }
    var vError = this.req.responseText.split("#|$");
    if(vError.length==2)
    {
       alert(vError[1]);
       if(vError[1]=="页面已过期，请重新登录")
       {
          LoadingAgain();
       }
       return;
    }
    m_lanTable = new listctrl("m_lanTable");
    m_lanTable.createlist("NlResult",15,parseInt(this.req.responseText),8);
    m_lanTable.Query = QureyLan;
    m_lanTable.Query(1, 15);
}
function QureyLan(pageIndex, pageSize)
{
     var params = "_method=ShowLanQurey&pageIndex="+pageIndex+"&pageSize="+ pageSize;
     CtnTrans.Ajax("/main.ashx", "post", params,ShowLanQurey,null,{loading:true,loadingText:"系统查询中，请稍候..."}); 
     //new net.ContentLoader("query.ashx?", ShowLanQurey, null, "_method=ShowLanQurey&pageIndex="+pageIndex+"&pageSize="+ pageSize); 
}
function ShowLanQurey(res)
{   
    var XmlVal = getXmlDoc()
    if (XmlVal == null)
    {
        alert("不能创建XML对象")
        return
    }
    var vError = res.responseText.split("#|$");
    if(vError.length==2)
    {
       alert(vError[1]);
       if(vError[1]=="页面已过期，请重新登录")
       {
          LoadingAgain();
       }
       return;
    }
    
    var ResText = res.responseText;
    m_lanTable.insertXmlByElem(ResText);
    m_lanTable.displist();
    var vUndifined = "<NewDataSet></NewDataSet>";
    if(ResText!=vUndifined)
    {
        document.getElementById("NlResult").style.display = "block";
    }
    else
    {
        document.getElementById("NlResult").style.display = "none";
        alert("没有找到相关的LAN设备信息，请与后台维护人员联系...");
  
    }
    
}
function ShowDivQurey(vGgSsMc,vWz)
{    

     var DivQureyFxh = document.getElementById("DivQureyFxh");
     var EntLocDiv =top.Map.TraceLocation;
     EntLocDiv.style.display = "none";
     var szHtm =  "<table bgcolor='white' border='0' cellspacing='0' cellpadding='0' background='img/Map/map_bomer_dt_039.gif' Z-index:50 ";
     var vhead = ""; 
     if(vGgSsMc==null || vGgSsMc=="")
     {   
         vhead = "区域查询";
         szHtm+="width='230px'>";
     }
     else
     {
          vhead = "实体信息";
          szHtm+="width='280px'>";
     }
     szHtm += "<tr><td width='7'height='32'></td><td width='18' bgcolor='#C8DEF4'><img src='Images/Map/mapLeftFb.gif' border='0'></td>";
     szHtm += "<td bgcolor='#C8DEF4' background='Images/Map/mapMid.gif' class='td'>"+vhead+"</td><td ><img src='Images/Map/closeDiv1.gif' onclick=DispDiv()></td><td width='18'><img src='Images/Map/mapRight.gif' border='0'></td></tr>";
     szHtm += "<tr><td></td><td background='Images/Map/map_BLeft.gif'></td>";
     szHtm += "<td height='50' align='center' background=Images/Map/map_bomer_dt_039.gif><table border='0' cellspacing='0' cellpadding='0'>";
     szHtm += "<tr><td align=center><table border=0>";
     if(vGgSsMc!=null && vGgSsMc!="")
     {   
          szHtm +="<tr valign='top'><td class='td' width='80px'><strong>设施名称：<strong></td>";
          szHtm += "<td class='td'><font color='#003399'>"+vGgSsMc+"</font></td></tr>";
          szHtm +="<tr valign='top'><td class='td' width='80px'><strong>所在位置：<strong></td>";
          szHtm += "<td class='td'>"+ vWz+"</td></tr>";
     }
     szHtm += "<tr><td colspan='2' class='td'>搜索 "+m_vRadius+" 米以内的分线盒</td></tr>";
//     szHtm += "<tr><td colspan='2' class='td'>搜索<input type='text'id='WndTxt' class='g2' value='50'>米以内的分线盒</td></tr>";
     szHtm += "<tr><td align='center' colspan='2'><input type='button' value='搜 索' class='SeleQuCss' onclick='FgfwQureyCir()'></td></tr>"
     szHtm += "</table></td></tr><tr><td align=center></td></tr></table></td><td></td><td background='Images/Map/map_BRight.gif'></td></tr><tr><td></td>";
     szHtm += "<td colspan='4'><table cellpadding='0' cellspacing='0' border='0' ><tr><td><img src='Images/Map/map_bomerLeft.gif'></td>";
     szHtm += "<td width='100%' background='Images/Map/map_bomerMid.gif'></td><td><img src='Images/Map/map_bomerRight.gif'></td></tr></table></td></tr></table>";
     DivQureyFxh.innerHTML = szHtm;
     if(vGgSsMc!=null || vGgSsMc!="")
     {
         DivQureyFxh.style.display="block";
     }
     else
     {
        FgfwQureyCir();
     }
    
//     }
    

}
function DispDiv()
{
     var DivQureyFxh = document.getElementById("DivQureyFxh");
     DivQureyFxh.style.display="none";
}
function ShowGgSs(res)//获取公共设施的属性信息
{
     var XmlVal = getXmlDoc()
     if (XmlVal == null)
     {
          alert("不能创建XML对象");
          return;
     }
     var  ResPonse = res.responseText.split("#|$");
     if(ResPonse.length==2)
     {  
       
          alert(ResPonse[1]);
          if(ResPonse[1]=="页面已过期，请重新登录")
          {
             LoadingAgain();
          }
          ZyqrFrame.btQurey.disabled=false;
          return;
     }
     else
     {
          ResPonse = res.responseText.split("#@$");
     }
     var vGgSsMc = ResPonse[0];
     var vGgSsAddr = ResPonse[1];
     var vEnt = ResPonse[2];
         vX   = ResPonse[3]
         vY   = ResPonse[4]
     top.m_vGgSsXY = vX+":"+vY;
     ShowDivQurey(vGgSsMc,vGgSsAddr);
}

function LogStat()
{
    var vClintWid = screen.width;
    var vClintHei = screen.height;
    window.open("Stat.aspx", null ,"top=0,left=0,width="+vClintWid+",height="+vClintHei+" ", "status=no,resizable=no,toolbar=no,menubar=no,scrollbars=no, location=no");
}
function LogOut()
{
    alert("您已成功退出系统!");
    CloseWindow();
    if(window.softType!="YTQ")
    {
         window.open("Login.aspx");
    }
	window.opener="xxx"
	window.close();
}
function chagePage()
{
    window.open("Login.aspx");

}
function GotoLogin()
{
     window.location.href = "Login.aspx?"; 
}
function CloseWindow()
{  
    
}
function ShowUpdateUser()
{
    window.open("EditUser.aspx",null,"top=0,left=0,width="+screen.width+",height="+screen.height+" ", "status=no,resizable=no,toolbar=no,menubar=no,scrollbars=no, location=no");
}
//禁用F5
function NotUserF5()
{
    var oEl= event.scrElement;
    if(event.keyCode==116)
    {
        event.keyCode=0;
        event.returnValue=false;
    }
}
//显示详细信息
function ShowDetailMess(ID)
{
    var vData    = ID.id;
    var strSplit = vData.split("#|$");
    var szHtm = "<table border='0' cellspacing='0' cellpadding='0' 	background-color= '#FFFFFF' width='94%'>";
        szHtm += "<tr><td align=left ><table border=0>";
        szHtm += "<tr><td class='td4'>分线盒编码：<font color=red>"+ChgUndefined(strSplit[2])+"<font></td></tr>";//Fxhbm
        szHtm +="<tr><td class='td4'>所属局向信息：<font color=red>"+ChgUndefined(strSplit[9])+"("+ChgUndefined(strSplit[10])+")"+"</font></td></tr>"
        szHtm += "<tr><td class='td4'>可提供语音线路资源数量：<font color='#003399'>"+ChgUndefined(strSplit[4])+"</font></td></tr>";
        szHtm +="<tr><td class='td4'>可提供宽带线路资源数量：<font color='#003399'>"+ChgUndefined(strSplit[5])+"</font></td></tr>"
        szHtm += "<tr><td class='td4'>最近宽带接入设备名称：<font color='#003399'>"+ChgUndefined(strSplit[17])+"</font></td></tr>"
        szHtm +="<tr><td class='td4'>最近接入点距离：<font color='#003399'>"+ChgUndefined(strSplit[8])+"米</font></td></tr>"
        szHtm += "<tr><td class='td4'>覆盖地址：<font color='#003399'>"+ChgUndefined(strSplit[7])+"</font></td></tr>";
        szHtm +="<tr><td class='td4'>分线盒安装地址：<font color='#003399'>"+ChgUndefined(strSplit[6])+"</font></td></tr></table>";
        szHtm +="</table></td></tr></table>";
        var dlg = new CtnDlgCtrl();
        var params = {title:"详细信息",
         content:szHtm,
         bmove:true,
         bmodal:false,
         bmax : false,
         bmin : false,
         width:280,height:330,
         arrbtn: [{text:"关闭", onClick:function(){dlg.close();},input:"SeleQuCss"}]
         }
         dlg.init(params);
         dlg.open();
}
//显示LAN局向信息
function  ShowLanJx(ID)
{
    var vData = ID.id.split("|");
    var vJxbm = vData[0];
    var vQureyType = vData[1];
    m_type = vQureyType;
    var params = "_method=ShowDuanKou&JXBM="+escape(vJxbm)+"&QureyType="+escape(vQureyType);
    CtnTrans.Ajax("/main.ashx", "post", params,ShowDuanKou,null,{loading:true,loadingText:"系统查询中，请稍候..."}); 

    //var loaderXml = new net.ContentLoader("query.ashx?",ShowDuanKou, null, "_method=ShowDuanKou&JXBM="+escape(vJxbm)+"&QureyType="+escape(vQureyType));
}
function ChgUndefined(charName)
{
   // if(charName=="undefined" || charName=="")
    if(charName==undefined || charName=="" || charName =="NaN")
    {
        charName = "&nbsp";
    }
    return charName;
}
function ShowDuanKou(res)
{
    var XmlVal = getXmlDoc()
    if (XmlVal == null)
    {
         alert("不能创建XML对象");
        return;
    }
    var  ResPonse = res.responseText.split("#|$");
    if(ResPonse.length==2)
    {  
          alert(ResPonse[1]);
          if(ResPonse[1]=="页面已过期，请重新登录")
          {
             LoadingAgain();
          }
          ZyqrFrame.btQurey.disabled=false;
          return;
    }
    else
    {
         ResPonse = res.responseText.split("#@$");
    }
    var vJxNum = ResPonse[0];
    var vValue = ResPonse[1];
    var vSpltNum  = vJxNum.split(",");
    var vSpltValue = vValue.split(",");
    var szHtm = "<table border='0' cellspacing='0' cellpadding='0'  width='258px'>";
    szHtm += "<tr><td align=center><table border=0 width='258px'style='background-color:white'>";
    for(var i=0;i < vSpltValue.length; i++)
    {
        var vValue = ChgUndefined(vSpltNum[i]);
        szHtm +="<tr><td class='td'>"+vSpltValue[i]+"：<font color='#003399'>"+vValue+"<font></td></tr>";
    }
     szHtm +="</table></td></tr></table>";
     var dlg = new CtnDlgCtrl();
     var params = {title:"端口信息",
     content:szHtm,
     bmove:true,
     bmodal:false,
     bmax : false,
     bmin : false,
     width:275,height:180,
     arrbtn: [{text:"关闭", onClick:function(){dlg.close();},input:"SeleQuCss"}]
     }
     dlg.init(params);
     dlg.open();
}
function SaveResJxOnly()
{

}
